package org.walker.iotScheduling.modules.iot.v1.timeTask.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.walker.iotScheduling.modules.iot.task.ScheduledTask;
import org.walker.iotScheduling.modules.iot.v1.timeTask.TimeStrategy;

/**
 * 设置每十秒执行一次
 */
@Component
public class FixedRateSchedulingStrategyTenSeconds implements TimeStrategy {

    @Autowired
    @Qualifier("commonTask")
    private ScheduledTask task;

    /**
     * 每五秒执行一次的任务调度
     */
    @Override
    //@Scheduled(cron = "0/10 * * * * ? ")   先停止用V2
    public void scheduleTask() {
        task.execute();
    }
}
